<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div class="box">
    <div class="circle front">正面</div>
    <div class="circle back">反面</div>
  </div>
</body>
<style>
  * {
    margin: 0;
    padding: 0;
  }

  body {
    perspective: 500px;
  }

  .box {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 100px auto;
    font-size: 16px;
    line-height: 200px;
    text-align: center;
    /* transition: all 1s; */
    transform-style: preserve-3d;
    animation: flip 3s linear infinite;
  }

  .box .circle {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: skyblue;
  }

  .box .front {
    z-index: 1;
  }

  .box .back {
    transform: rotateY(180deg);
    background-color: palegoldenrod;
  }

  /* 手动，需要设置过渡效果 */
  /* .box:hover {
    transform: rotateY(180deg);
  } */

  @keyframes flip {
    from {}

    50% {
      transform: rotateY(180deg);
    }

    to {
      transform: rotateY(360deg);
    }
  }
</style>

</html>